import { request, requestFy } from '@/utils/request';

// 登录方法
export function login(username, password, captchaVerification) {
  const data = {
    username,
    password
  };
  return request({
    url: '/system/auth/login-cx',
    method: 'POST',
    data: data
  });
}
// 使用code，获得openid
export function getOpenIdByCode(code) {
  return request({
    url: `/system/auth/get-openid-by-logincode?code=${code}`,
    method: 'GET'
  });
}
// 获取用户详细信息
export function getInfo(data) {
  return requestFy({
    url: '/user-autor/get-permission-info-from-applet',
    method: 'POST',
    data: data,
    headers: {
      isToken: false
    }
  });
}

// 退出方法
export function logout() {
  return request({
    url: '/system/auth/logout',
    method: 'POST',
    data: {}
  });
}

// 获取所有字典表数据
export function getDictList() {
  return request({
    url: '/system/dict-data/list-all-simple',
    method: 'GET'
  });
}

// 修改密码
export function editPwd(data) {
  return request({
    url: '/system/auth/update-password-cx',
    method: 'POST',
    data: data,
    headers: {
      isToken: true
    }
  });
}

// 调运是否跳转
export function getJumpDispatchFlag(params) {
  return request({
    url: '/queue/tenant-config/get-jump-dispatch-flag',
    method: 'GET',
    params
  });
}
